using System;

namespace Catastrophe.AutoSulution.TaskM
{
	public class TaskComAttribute : Attribute
	{
		/// <summary>
		/// 生命周期
		/// </summary>
		public bool IsRunTime { get; set; }

		/// <summary>
		/// 延时启动时间
		/// </summary>
		public int DeleyTime { get; set; }

		/// <summary>
		/// 休眠时间
		/// </summary>
		public int SleepTime { get; set; }

		/// <summary>
		/// 是否保留任务（只有保留任务，后续才能进行任务管理功能）
		/// </summary>
		public bool SaveTask { get; set; }

		/// <summary>
		/// 是否立即执行或者等待信号
		/// </summary>
		public bool ImmediateExcute { get; set; }

		/// <summary>
		/// 是否记录周期
		/// </summary>
		public bool IsRecordCycleTime { get; set; }

		/// <summary>
		/// 记录周期点数
		/// </summary>
		public int RecordCycleTimePoint { get; set; }

		/// <summary>
		/// 功能
		/// </summary>
		public string Function { get; set; } = "";


		public TaskComAttribute(bool isRunTime, int sleepTime = 0, bool immediateExcute = true, bool saveTask = false, int deleyTime = 0)
		{
			this.IsRunTime = isRunTime;
			this.SleepTime = sleepTime;
			this.DeleyTime = deleyTime;
			this.SaveTask = saveTask;
			this.ImmediateExcute = immediateExcute;
		}
	}
}
